package com.softserveinc.autorent.controller;

import java.util.Collection;
import java.util.List;

import javax.ejb.EJB;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;

import com.softserveinc.autorent.model.Car;
import com.softserveinc.autorent.model.CarVendor;

@Stateless
@LocalBean
public class CarController //Он же фасад
{
	@EJB
	private CarManager carManager;
	
	
	public void create(Car c)
	{
		carManager.create(c);
	}
	
	public Car read(int id)
	{
		
		return carManager.read(id);
	}
	
	public void update(Car c)
	{
		carManager.update(c);
	}
	
	public void delete(int id)
	{
		 carManager.delete(id);
	}
	
	public void delete(Car c)
	{
		 carManager.delete(c);
	}
	
	public List<Car> getAll()
	{
		Collection<Car> c = carManager.getAll();
		
		return (List<Car>)c;
	}
	    
}
